#include <QtGui>
#include <QFrame>
#include <QMessageBox>
#include "demowidget.h"
#include "displaywindow.h"
#ifdef WIN32
#include <windows.h>
#include <QAxWidget>
#endif

DemoWidget::DemoWidget(bool isEditMode, std::vector<void *> ptr_vect, QWidget *parent): QWidget(parent)
{
    m_layoutMain =  new QGridLayout(this);
    m_layoutMain->setSpacing(0);
    m_layoutMain->setContentsMargins(0, 0, 0, 0);
    m_layoutMain->setObjectName(QString::fromUtf8("m_layoutMain"));
    m_layoutMain->setSizeConstraint(QLayout::SetMaximumSize);

    m_mainwindows = new MainWindow1( this );
    m_layoutMain->addWidget(m_mainwindows);
    this->show();
}


void DemoWidget::Release()
{
    delete this;
}

void DemoWidget::EmitItemAction(int id, QString action)
{
    emit itemAction( id, action);
}

void DemoWidget::SetProperty(QString &property_name, QVariant value)
{

}

void DemoWidget::GetProperty(std::list< std::pair<QString, QVariant> > &property_list)
{

}

DemoWidget::~DemoWidget()
{
    if (m_mainwindows)
    {
        delete m_mainwindows;
        //         m_mainwindows = NULL;
    }
    delete m_layoutMain;

}
/*
void DemoWidget::setRegionSet(RegionInstanceSet *pset)
{
    m_mainwindows->setRegionSet(pset);
}*/

void DemoWidget::TreeClick(int gid)
{
    m_mainwindows->ClickGroup(gid);
}
